*{margin: 0;padding: 0;}
body,html{width: 100%;height: 100%;background-color: lightgreen;overflow: hidden;}
@keyframes size {
    0% { transform: scale(0.9); }
    100% { transform: scale(1.1); }
}
.container {
    margin: 0 auto;margin-top: 5px; transition: all .6s; 
    position: relative; background: #456;
    background-size: 100% 110%; 
    width: 600px;height: 600px;
    border-radius: 10px;
}
.content{ position: absolute;top: 0;left: 0; background: rgba(0,0,0,.5);z-index: 999;width: 100%;height: 100%;}
.content button{
    position: absolute; 
    opacity: .8;
    background: linear-gradient(90deg, pink, rgb(235, 15, 205), rgb(240, 14, 119), rgb(156, 11, 240), rgb(4, 153, 252),pink);
    top: 50%;left: 50%;border: 0;width: 120px; height: 50px; 
    border-radius: 30px;outline: none;transform: translate(-50%,-50%);
    cursor: pointer;
    background-size: 600% ;
    animation: right 15s infinite linear;
    color: white;
    font-size: 20px;
    font-family: cursive;
    letter-spacing: 8px;
    border: 3px solid #456;
}
@keyframes right {
    to{ background-position: -600% 0%; }
}

.keep{ display: none;}
.food{ animation: size 1s linear infinite alternate; background: url('../images/food.png'); height: 20px;width: 20px;background-size: cover;z-index: 1; position: absolute;}
.snakehead{
    background: url('../images/snakehead.png');
    height: 20px;width: 20px;
    position: absolute;
    background-size: 100% 100%;z-index: 1;
}
.snakebody{
    background: #00A0E9;
    height: 20px;width: 20px;
    position: absolute;
    background-size: 100% 100%;z-index: 1;
    border-radius: 50%;
}
.score{
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    background-color: #123;
    padding: 10px 30px;
    border-radius: 8%;
    color: white;
}
.score::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-left: 3px solid red;
    border-top: 3px solid blue;
}
.score::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-right: 3px solid pink;
    border-top: 3px solid yellow;
}